package com.example.demo.r;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.concurrent.TimeUnit;

@Component
@Slf4j
public class TestR {

    @PostConstruct
    public void test() throws InterruptedException {
        int i = 0;
        while (true){
            TimeUnit.SECONDS.sleep(5);
            //System.out.println("第"+ i +"次处理,当前时间戳:"+System.currentTimeMillis());
            log.info("第"+ i +"次处理,当前时间戳:"+System.currentTimeMillis());
            i++;
        }
    }

}
